﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using nspJob;
using Base;

public partial class Member_Job_JobDetails : nspBase.MemberBasePge
{
    string id = "";
    RResume re = new RResume();
    protected void Page_Load(object sender, EventArgs e)
    {
        //判断是否有权限，以及用户是否登陆如果不是跳转页面
        if (!IsPostBack)
        {
            if (!CheckCookies())
            {
                Response.Redirect("../../login/login.aspx");
            }
            else
            {
                Bind();
            }
        }
    }
    public void Bind()
    {
        if (Request.QueryString["id"] != null)
        {
            id = Request["id"];
            ViewState["id"] = id;
        }

        DataTable table = re.GetDataTableByWhere(id);
        if (table.Rows.Count != 0)
        {
            this.txtPosition.Text = table.Rows[0]["WantPosition"].ToString();
            this.Image1.ImageUrl = table.Rows[0]["Photo"].ToString();
            this.lbSex.Text = table.Rows[0]["Sex"].ToString();
            this.txteducation.Text = table.Rows[0]["HighestEducation"].ToString();
            this.txtGraduteSchool.Text = table.Rows[0]["GraduateSchool"].ToString();
            this.txtNative.Text = table.Rows[0]["NativePlace"].ToString();
            this.txtWantAddress.Text = table.Rows[0]["WantAddress"].ToString();
            this.DrpTypePosition.Text = table.Rows[0]["TalentType"].ToString();
            this.txtAge.Text = Convert.ToDateTime(table.Rows[0]["DateofBirth"].ToString()).ToShortDateString();
            this.Radhunyin.Text = table.Rows[0]["MaritalStatus"].ToString();
            this.dropcomputer.Text = table.Rows[0]["ComputerRequest"].ToString();
            this.dropEnlish.Text = table.Rows[0]["EnglishRequest"].ToString();
            this.txtDescription.Text = table.Rows[0]["JobDescription"].ToString();
            this.txtPersonResum.Text = table.Rows[0]["PersResume"].ToString();
            this.dropsalary.Text = table.Rows[0]["WantSalary"].ToString();
            this.txtName.Text = table.Rows[0]["Name"].ToString();
            this.txtTelphone.Text = table.Rows[0]["Telephone"].ToString();
            this.txtEmail.Text = table.Rows[0]["Email"].ToString();
            this.txtQQ.Text = table.Rows[0]["QQ"].ToString();
            this.txtMobel.Text = table.Rows[0]["Mobile"].ToString();
            this.txtAddress.Text = table.Rows[0]["ContactAddress"].ToString();
            RResume rr = new RResume();
            DataTable tb_jobResume = new DataTable();
            int resumeid = 0;
            tb_jobResume = rr.GetDataJobResume(ViewState["id"].ToString());
            if (tb_jobResume.Rows[0]["mark"].ToString().Equals("2"))
            {
                Radfilter.Items[2].Selected = true;
            }
            if (tb_jobResume.Rows[0]["mark"].ToString().Equals("1"))
            {
                Radfilter.Items[1].Selected = true;
            }
            if (tb_jobResume.Rows[0]["mark"].ToString().Equals("3"))
            {
                Radfilter.Items[0].Selected = true;
            }
        }
    }

    ///**************************************************
    /// <summary>
    /// depiction：该方法是取消筛选
    /// </summary>
    /// <param name="<参数名称>"><参数说明></param>
    /// <returns>
    ///<对方法返回值的说明，该说明必须明确说明返回的值代表什么含义>
    /// </returns>
    ///Create Date：2009-9-4
    ///**************************************************
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        Response.Write("<script>location.assign('CompanyResumeList.aspx');</script>");
    }

    ///**************************************************
    /// <summary>
    /// depiction：该方法用于筛选简历
    /// </summary>
    /// <param name="<参数名称>"><参数说明></param>
    /// <returns>
    ///<对方法返回值的说明，该说明必须明确说明返回的值代表什么含义>
    /// </returns>
    ///Create Date：2009-9-4
    ///**************************************************  
    protected void btnSave_Click(object sender, EventArgs e)
    {
        RResume rr = new RResume();
        DataTable tb_jobResume = new DataTable();
        int resumeid = 0;
        tb_jobResume = rr.GetDataJobResume(ViewState["id"].ToString());
        resumeid = Convert.ToInt32(tb_jobResume.Rows[0]["id"]);
        if (Solely.Other.UpOnlyDate("C_JobResume", "mark='" + this.Radfilter.SelectedValue + "'", "id =" + resumeid)) ;
        {
            Bind();
            Response.Write("<script>alert('筛选成功');location.assign('CompanyResumeList.aspx');</script>");

        }
    }
}
